package com.zzzy.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.zzzy.po.User;
import com.zzzy.service.UserService;

@RestController
public class HelloController {

	@Autowired
	private UserService userService;
	
	@RequestMapping("/hello")
	@ResponseBody
	public String test() {
		System.out.println("hello run");
		
		List<User> userList = userService.queryAllUser();
		System.out.println("username:" + userList.get(0).getUsername());
		
		return userList.get(0).getUsername();
		//return "Hello";
	}
}
